<template>
  <div class="main">
    <div class="header">在线聊天登录</div>
    <div class="footer">
      <div class="login">
        <el-input v-model="loginParam.username" placeholder="请输入用户名"></el-input>
        <br>
      <el-input placeholder="请输入密码" v-model="loginParam.password" show-password></el-input>
      <br>
      <el-button type="success" @click="login()">登录</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
          loginParam:{
            username: "maqinglin",
            password: "maqinglin"
          }
        };
    },
    methods:{
      login(){
        this.$http.post('/system/sysUser/login',this.loginParam).then(res=>{
          if(res.data.code==200){
            this.$notify({
          title: '成功',
          message: '登录成功',
          type: 'success'
        });
        this.$router.push({name:'Chat',params:{userInfo:res.data.data}});
          }else{
            this.$notify.error({
          title: '错误',
          message: '这是一条错误的提示消息'
        });
          }
        })
      }
    }
}
</script>

<style>
.main{
width: 1520px;
height: 720px;
background-color: #409EFF;
}
.header{
  width: 100%;
  height: 100px;
  background-color: rgb(102, 177, 255);
  text-align: center;
  line-height: 100px;
}
.footer{
  width: 100%;
  height: 620px;
  background-color:#409EFF;
  text-align: center;
}
.el-input{
  width: 500px;
}
.login{
  padding-top: 200px;
  line-height: 50px;
}
.el-button{
  width: 500px;
}
</style>
